package com.zzc.hankz.session;

import com.zzc.hankz.builder.xml.XMLConfigBuilder;
import com.zzc.hankz.session.defaults.DefaultSqlSessionFactory;
import java.io.Reader;

/**
 * sqlSessionFactory建造者工厂
 *
 * @author：zzc
 * @date: 2022/4/11
 */
public class SqlSessionFactoryBuilder {

    public SqlSessionFactory build(Reader reader) {
        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder(reader);
        return build(xmlConfigBuilder.parse());
    }

    private SqlSessionFactory build(Configuration config) {
        return new DefaultSqlSessionFactory(config);
    }
}
